There are <?php echo $this->book_list->count(); ?> <a href="books.php">books</a> in our store
<ol>
<?php foreach ($this->book_list as $book) : ?>
	
	<?php $authors = $book->getAuthors()->replaceCols('author.id, author.name')->setFetchMode(PDO::FETCH_KEY_PAIR)->fetchAll(); ?>
	<li>&laquo;<?php echo $book->title; ?>&raquo; by 
		<?php echo count($authors) ? implode(', ', $authors) : '<i>no author</i>'; ?></li> 
<?php endforeach; ?>
</ol>

There are <?php echo $this->author_list->count(); ?> <a href="authors.php">authors</a> in our database
<ol>
<?php foreach ($this->author_list as $author) : ?>
	
	<?php $books = $author->getBooks()->replaceCols('book.id, book.title')->setFetchMode(PDO::FETCH_KEY_PAIR)->fetchAll(); ?>
	<li><?php echo $author->name; ?>: &laquo;<?php echo implode('&raquo;, &laquo;', $books); ?>&raquo;</li> 
<?php endforeach; ?>
</ol>